/*
 * Copyright (c) 2025 Industrial Software Feature Database
 */
package com.comac.ins.isfd.util;

import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.comac.ins.common.core.exception.base.BaseException;
import com.comac.ins.common.core.utils.StringUtils;
import com.comac.ins.isfd.constant.IsfdMeshModelConstants;
import com.comac.ins.isfd.constant.enums.IsfdMeshModelFilteredEnum;
import com.comac.ins.isfd.constant.enums.IsfdModelMeshFileSuffixEnum;
import com.comac.ins.isfd.constant.enums.PartFileTypeEnum;
import com.comac.ins.isfd.domain.bo.IsfdMeshModelFilterRulesBo;
import com.comac.ins.isfd.domain.bo.IsfdMeshSectionInfoConfigBo;
import com.comac.ins.isfd.domain.vo.IsfdMeshModelStructureDefinitionVo;
import com.comac.ins.isfd.service.IIsfdMeshModelStructureDefinitionService;
import com.comac.ins.system.service.ISysDictDataService;
import com.fasterxml.jackson.core.JsonProcessingException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

@Slf4j
@Component
public class RegexMatcher {
    @Autowired
    private IIsfdMeshModelStructureDefinitionService iIsfdMeshModelStructureDefinitionService;

    @Autowired
    private ISysDictDataService iSysDictDataService;

    /**
     * 根据零件截取出零件编号 和 版本
     * 比如吧：
     * 5231C10013G71_A.bdf --> 5231C10013G71 A
     * R_5231C10000G21_B1.bdf --> R_5231C10000G21 B1
     */
    public static String[] getPartNumber(String partName) {
        String partNumber = StringUtils.substringBeforeLast(partName, ".");
        String versionNumber = StringUtils.substringAfterLast(partNumber, "_");
        String[] partSplit = partNumber.split("_");
        if (partNumber.startsWith("R_") && partSplit.length == 3) {
            partNumber = partSplit[0] + "_" + partSplit[1];
            return new String[]{partNumber, versionNumber};
        }

        if (StringUtils.isNotBlank(versionNumber) && versionNumber.length() == 1 && isUpperCaseLetter(versionNumber.charAt(0))) {
            partNumber = StringUtils.substringBeforeLast(partNumber, "_");
        }

        return new String[]{partNumber, versionNumber};
    }

    public static boolean isUpperCaseLetter(char c) {
        return Character.isUpperCase(c) && c >= 'A' && c <= 'Z';
    }

    /**
     * 判断文件类型
     * 如果 文件内容包含 include  则是索引文件
     * 如果 文件名是否包含R_开头 则是紧固件
     * 如果 文件名是否是Gxx或者Gxx.x结尾（x代表数字） 则是零件
     * 都不满足就是 外置文件
     */
    public static PartFileTypeEnum matchesPartFileType(String input, List<String> resultList) {
        if (CollectionUtils.isNotEmpty(resultList)) {
            return PartFileTypeEnum.INDEX;
        }

        if (input.startsWith("R_")) {
            return PartFileTypeEnum.FASTENER;
        }

        String patternString = "^.*G\\d{2}(\\.\\d+)?$";
        Pattern pattern = Pattern.compile(patternString);
        Matcher matcher = pattern.matcher(input);
        if (matcher.matches()) {
            return PartFileTypeEnum.PART;
        }

        return PartFileTypeEnum.EXTERNAL;
    }

    /**
     * 拼接文件存储位置的全路径
     * 比如：/data/model/management/part/data/${批次编号}/C919_10002/C919_S11/5319C97000G22/5319C97003G71_A.bdf
     */
    public static String getDataPath(String prePath, String batchNumber, String indexPath) {
        return prePath + batchNumber + "/" + indexPath;
    }

    /**
     * 把架次好加进去
     * 比如：/data/model/management/part/data/${批次编号}/C919/C919_S11/5319C97000G22/5319C97003G71_A.bdf
     * -->
     * 比如：/data/model/management/part/data/${批次编号}/C919_10002/C919_S11/5319C97000G22/5319C97003G71_A.bdf
     */
    public static String rebuildOldDataPath(String prePath, String batchNumber, String indexPath, String sortie) {
        String[] indexPaths = indexPath.split("/");
        StringBuilder newIndexPath = new StringBuilder();
        for (int i = 0; i < indexPaths.length; i++) {
            if (i == 0) {
                newIndexPath.append(indexPaths[i]);
                if (StringUtils.isNotBlank(sortie)) {
                    newIndexPath.append("_").append(sortie);
                }
            } else {
                newIndexPath.append("/").append(indexPaths[i]);
            }
        }
        return prePath + batchNumber + "/" + newIndexPath;
    }

    /**
     * 拼接文件前缀存储位置
     * 比如：
     * /data/model/management/part/data/${批次编号}
     * /data/model/management/part/temp/${批次编号}
     */
    public static String getDataPrePath(String prePath, String batchNumber) {
        return prePath + batchNumber;
    }

    /**
     * 删除indexPath 开头的batchNumber
     */
    public static String removeBatchNumberInPath(String indexPath, String batchNumber) {
        if (indexPath.startsWith(batchNumber)) {
            return indexPath.replace(batchNumber + "/", "");
        }
        return indexPath;
    }

    /**
     * 重构indexPath
     * 1.删除批次号
     * 2.机型位置重构，去除架次
     * 比如：
     * batch1/C919_10002/C919_10002_D20200910.bdf
     * batch1/C919_10002/C919_S50/C919_S50_D20200514.bdf
     * batch1/C919_10002/C919_S20/5346C11000G22/5346C11011G70_C.bdf
     * C919
     * -->
     * C919/C919_10002_D20200910.bdf
     * C919/C919_S50/C919_S50_D20200514.bdf
     * C919/C919_S20/5346C11000G22/5346C11011G70_C.bdf
     */
    public static String reBuildIndexPath(String indexPath, String modelNumber) {

        String[] indexPaths = indexPath.split("/");
        StringBuilder newIndexPath = new StringBuilder();
        newIndexPath.append(modelNumber);
        for (int i = 0; i < indexPaths.length; i++) {
            if (i == 0 || i == 1) {
                continue;
            }
            newIndexPath.append("/").append(indexPaths[i]);
        }
        return newIndexPath.toString();
    }

    /**
     * 根据机型索引索引和机型编码切分出架次字段
     * 比如：
     * batch1/C919_10002/C919_10002_D20200910.bdf
     * C919
     * --> 10002
     */
    public static String getSortie(String modelIndexPath, String modelNumber) {
        String[] modelIndexPaths = modelIndexPath.split("/");
        String oldModelNumber = modelIndexPaths[1];
        if (oldModelNumber.contains(modelNumber)) {
            String temp = oldModelNumber.replaceAll(modelNumber, "");
            return temp.replaceAll("_", "");
        }
        return null;
    }


    /**
     * 将架次替换成输入的架次
     */
    public static String replaceModelAndSortie(String partIndex, String modelNumber, String sortie) {
        if (StringUtils.isBlank(sortie)) {
            return partIndex;
        }
        String[] partIndexs = partIndex.split("/");
        StringBuilder newIndexPath = new StringBuilder();
        newIndexPath.append(modelNumber);
        for (int i = 0; i < partIndexs.length; i++) {
            if (i == 0) {
                newIndexPath.append("_").append(sortie);
            } else {
                newIndexPath.append("/").append(partIndexs[i]);
            }
        }
        return newIndexPath.toString();
    }


    /**
     * .
     * 根目录下以“Model”开头的文件名将放入到“全机”文件类型中。
     * 根目录下以第一个“_”+“S”命名的文件将根据部段的命名规则放入到对应部段文件类型中。
     * “P_load”文件夹的文件将放入到“气密卡”文件类型中。
     * 只存入.dat、.out、.bdf类型的文件，其余格式文件将自动剔除。
     * <p>
     * 如果不在构型定义里面的部段会被过滤掉，比如：
     * 构型定义里只有S12，压缩包理由S12、S17、S18，那么只有S12会落库，S17和S18会在过滤掉的文件里
     */
    public IsfdMeshModelFilterRulesBo meshModelFilterRules(String modelNumber, String fileName, String fileSuffix) {
        String sectionInfoConfig = iSysDictDataService.selectDictValueByTypeAndLabel(IsfdMeshModelConstants.MODEL_MESH,
            IsfdMeshModelConstants.SECTION_INFO_CONFIG);
        if (StringUtils.isBlank(sectionInfoConfig)) {
            throw new BaseException("自然网格模型库配置字典中，未配置 部段名称配置信息数据，请配置之后进行上传。");
        }
        List<IsfdMeshSectionInfoConfigBo> sectionInfoConfigBoList = new ArrayList<>();
        try {
            sectionInfoConfigBoList = IsfdMeshSectionInfoConfigBo.init(sectionInfoConfig);
        } catch (Exception e) {
            log.error("自然网格模型库配置字典中，部段名称配置信息数据转换失败，请确认配置正确后，重新上传！");
        }

        IsfdMeshModelFilterRulesBo result = new IsfdMeshModelFilterRulesBo();
        String[] fileNames = fileName.split("_");
        String sectionNumber = null;
        String sectionName = null;
        Integer filtered = null;
        if (fileName.startsWith(IsfdMeshModelConstants.MODEL_MESH_MODEL_PREFIX)) {
            filtered = IsfdMeshModelFilteredEnum.NOT_FILTERED.getValue();
            IsfdMeshSectionInfoConfigBo matchResultBo = matchFileKeyAndName(sectionInfoConfigBoList, fileName, null);
            sectionName = matchResultBo != null ? matchResultBo.getName() : null;
        } else if (fileNames.length >= 2 && fileNames[1].startsWith(IsfdMeshModelConstants.MODEL_MESH_S)) {
            filtered = IsfdMeshModelFilteredEnum.NOT_FILTERED.getValue();
            sectionNumber = fileNames[1];
            IsfdMeshModelStructureDefinitionVo sectionVo = iIsfdMeshModelStructureDefinitionService.queryOneByQueryIndex(modelNumber, sectionNumber, null);
            if (sectionVo != null) {
                IsfdMeshSectionInfoConfigBo matchResultBo = matchFileKeyAndName(sectionInfoConfigBoList, fileName, null);
                sectionName = matchResultBo != null ? matchResultBo.getName() : null;
            } else {
                filtered = IsfdMeshModelFilteredEnum.FILTERED.getValue();
                sectionNumber = IsfdMeshModelConstants.OTHER;
                sectionName = IsfdMeshModelConstants.OTHER_CN;
            }
        } else if (fileNames.length >= 2 && fileName.toLowerCase().startsWith(IsfdMeshModelConstants.MODEL_MESH_P_LOAD_IGNORE_CASE)) {
            filtered = IsfdMeshModelFilteredEnum.NOT_FILTERED.getValue();
            sectionNumber = IsfdMeshModelConstants.MODEL_MESH_P_LOAD;
            sectionName = IsfdMeshModelConstants.MODEL_MESH_P_LOAD_NAME;
        } else {
            IsfdMeshSectionInfoConfigBo matchResultBo = matchFileKeyAndName(sectionInfoConfigBoList, fileName, null);
            sectionName = matchResultBo != null ? matchResultBo.getName() : null;
            if (StringUtils.isBlank(sectionName)) {
                filtered = IsfdMeshModelFilteredEnum.FILTERED.getValue();
                sectionNumber = IsfdMeshModelConstants.OTHER;
                sectionName = IsfdMeshModelConstants.OTHER_CN;
            } else {
                filtered = IsfdMeshModelFilteredEnum.NOT_FILTERED.getValue();
                sectionNumber = matchResultBo.getKeyword();
            }
        }

        // 单独过滤一下，文件后缀不满足直接过滤掉
        if (IsfdModelMeshFileSuffixEnum.forValue(fileSuffix.toLowerCase()) == null) {
            filtered = IsfdMeshModelFilteredEnum.FILTERED.getValue();
            sectionNumber = IsfdMeshModelConstants.OTHER;
            sectionName = IsfdMeshModelConstants.OTHER_CN;
        }
        result.setSectionNumber(sectionNumber);
        result.setSectionName(sectionName);
        result.setFiltered(filtered);
        return result;
    }


    public static IsfdMeshSectionInfoConfigBo matchFileKeyAndName(List<IsfdMeshSectionInfoConfigBo> sectionInfoConfigBoList,
                                                                  String fileName,
                                                                  IsfdMeshSectionInfoConfigBo lastMatchedResult) {
        // 按 keyword 长度从长到短排序
        Collections.sort(sectionInfoConfigBoList, Comparator.comparingInt(s -> -s.getKeyword().length()));

        // 遍历每个节点
        for (IsfdMeshSectionInfoConfigBo section : sectionInfoConfigBoList) {
            // 检查文件名是否以当前节点的 keyword 开头（不区分大小写）
            if (fileName.toLowerCase().startsWith(section.getKeyword().toLowerCase())) {
                // 如果匹配成功，截取掉 keyword 前缀
                String newFileName = fileName.substring(section.getKeyword().length());
                // 如果 newFileName 以 "_" 开头，去掉 "_"
                if (newFileName.startsWith("_")) {
                    newFileName = newFileName.substring(1);
                }
                // 如果当前节点没有子节点，返回当前节点的 key 和 name
                if (section.getChildren().isEmpty()) {
                    return new IsfdMeshSectionInfoConfigBo(section.getKeyword(), section.getName());
                }
                // 递归匹配子节点，传入当前节点的 key 和 name 作为 lastMatchedResult
                return matchFileKeyAndName(section.getChildren(), newFileName, new IsfdMeshSectionInfoConfigBo(section.getKeyword(), section.getName()));
            }
        }

        // 如果没有匹配到任何 keyword，截取掉最左边的 "_" 及其前面的部分
        int underscoreIndex = fileName.indexOf('_');
        if (underscoreIndex != -1) {
            String newFileName = fileName.substring(underscoreIndex + 1);
            // 递归匹配剩余的文件名，保留上一次匹配的 key 和 name
            return matchFileKeyAndName(sectionInfoConfigBoList, newFileName, lastMatchedResult);
        }

        // 如果 fileName 被截取完仍未匹配到，返回上一次匹配的 key 和 name
        return lastMatchedResult;
    }

    public static void main(String[] args) throws JsonProcessingException {
        String sectionInfoConfig = "[{\"keyword\":\"S10\",\"name\":\"机身交界面节点\",\"children\":[{\"keyword\":\"section_node\",\"name\":\"机身交界面节点\",\"children\":[]}]},{\"keyword\":\"S11\",\"name\":\"机头\",\"children\":[{\"keyword\":\"NLG\",\"name\":\"前起落架\",\"children\":[]}]},{\"keyword\":\"S12\",\"name\":\"前机身\",\"children\":[]},{\"keyword\":\"S20\",\"name\":\"中机身\",\"children\":[]},{\"keyword\":\"S31\",\"name\":\"中后机身\",\"children\":[]},{\"keyword\":\"S32\",\"name\":\"后机身\",\"children\":[{\"keyword\":\"section_card\",\"name\":\"后机身与尾翼连接\",\"children\":[]}]},{\"keyword\":\"S50\",\"name\":\"垂尾\",\"children\":[]},{\"keyword\":\"S60\",\"name\":\"平尾\",\"children\":[]},{\"keyword\":\"S70\",\"name\":\"机翼\",\"children\":[{\"keyword\":\"INFLAP\",\"name\":\"机翼-内襟翼\",\"children\":[]},{\"keyword\":\"OUTFLAP\",\"name\":\"机翼-外襟翼\",\"children\":[]},{\"keyword\":\"SLAT\",\"name\":\"机翼-缝翼\",\"children\":[]},{\"keyword\":\"SLAT_ADD\",\"name\":\"机翼-缝翼挡块\",\"children\":[]},{\"keyword\":\"TE\",\"name\":\"机翼-固定后缘\",\"children\":[]},{\"keyword\":\"FL\",\"name\":\"机翼-固定前缘\",\"children\":[]},{\"keyword\":\"12TRACK\",\"name\":\"机翼-内襟翼运动机构\",\"children\":[]},{\"keyword\":\"34TRACK\",\"name\":\"机翼-外襟翼运动机构\",\"children\":[]},{\"keyword\":\"SPOILER\",\"name\":\"机翼-扰流板\",\"children\":[]},{\"keyword\":\"OUTWINGBOX\",\"name\":\"机翼-外翼盒段\",\"children\":[]},{\"keyword\":\"WINGLET\",\"name\":\"机翼-小翼\",\"children\":[]},{\"keyword\":\"CWB\",\"name\":\"机翼-中央翼\",\"children\":[]},{\"keyword\":\"pylon_node\",\"name\":\"机翼-吊挂连接点\",\"children\":[]},{\"keyword\":\"takeoff\",\"name\":\"机翼-起飞\",\"children\":[]},{\"keyword\":\"cruise\",\"name\":\"机翼-巡航\",\"children\":[]},{\"keyword\":\"land\",\"name\":\"机翼-着陆\",\"children\":[]},{\"keyword\":\"landing\",\"name\":\"机翼-着陆\",\"children\":[]},{\"keyword\":\"goaround\",\"name\":\"机翼-复飞\",\"children\":[]},{\"keyword\":\"mcheck1\",\"name\":\"机翼-操纵检查Ⅰ\",\"children\":[]},{\"keyword\":\"mcheck2\",\"name\":\"机翼-操纵检查Ⅱ\",\"children\":[]},{\"keyword\":\"AILERON\",\"name\":\"机翼-副翼\",\"children\":[]},{\"keyword\":\"LINK\",\"name\":\"固定后缘与外翼盒段连接\",\"children\":[{\"keyword\":\"AI\",\"name\":\"副翼与固定后缘连接\",\"children\":[]},{\"keyword\":\"CWB\",\"name\":\"中央翼与外翼盒段连接\",\"children\":[]},{\"keyword\":\"FL\",\"name\":\"固定前缘与外翼盒段连接\",\"children\":[]},{\"keyword\":\"FLAP_TRACK\",\"name\":\"襟翼与襟翼运动机构连接\",\"children\":[]},{\"keyword\":\"SLAT_FL\",\"name\":\"缝翼与固定前缘连接\",\"children\":[]},{\"keyword\":\"WINGLET\",\"name\":\"小翼与外翼盒段连接\",\"children\":[]},{\"keyword\":\"SP_TE\",\"name\":\"扰流板与固定后缘连接\",\"children\":[]},{\"keyword\":\"TRACK\",\"name\":\"襟翼运动机构与机翼机身连接\",\"children\":[]}]}]},{\"keyword\":\"S80\",\"name\":\"机翼\",\"children\":[{\"keyword\":\"INFLAP\",\"name\":\"机翼-内襟翼\",\"children\":[]},{\"keyword\":\"OUTFLAP\",\"name\":\"机翼-外襟翼\",\"children\":[]},{\"keyword\":\"SLAT\",\"name\":\"机翼-缝翼\",\"children\":[]},{\"keyword\":\"SLAT_ADD\",\"name\":\"机翼-缝翼挡块\",\"children\":[]},{\"keyword\":\"TE\",\"name\":\"机翼-固定后缘\",\"children\":[]},{\"keyword\":\"FL\",\"name\":\"机翼-固定前缘\",\"children\":[]},{\"keyword\":\"12TRACK\",\"name\":\"机翼-内襟翼运动机构\",\"children\":[]},{\"keyword\":\"34TRACK\",\"name\":\"机翼-外襟翼运动机构\",\"children\":[]},{\"keyword\":\"OUTWINGBOX\",\"name\":\"机翼-外翼盒段\",\"children\":[]},{\"keyword\":\"AILERON\",\"name\":\"机翼-副翼\",\"children\":[]},{\"keyword\":\"LINK\",\"name\":\"固定后缘与外翼盒段连接\",\"children\":[{\"keyword\":\"FLAP_TRACK\",\"name\":\"襟翼与襟翼运动机构连接\",\"children\":[]},{\"keyword\":\"SLAT_FL\",\"name\":\"缝翼与固定前缘连接\",\"children\":[]},{\"keyword\":\"TRACK\",\"name\":\"襟翼运动机构与机翼机身连接\",\"children\":[]}]}]},{\"keyword\":\"S90\",\"name\":\"吊挂超单元\",\"children\":[]},{\"keyword\":\"Model\",\"name\":\"全机总模型\",\"children\":[{\"keyword\":\"00\",\"name\":\"全机总模型-静力\",\"children\":[]},{\"keyword\":\"takeoff\",\"name\":\"全机总模型-起飞\",\"children\":[]},{\"keyword\":\"cruise\",\"name\":\"全机总模型-巡航\",\"children\":[]},{\"keyword\":\"land\",\"name\":\"全机总模型-着陆\",\"children\":[]},{\"keyword\":\"goaround\",\"name\":\"全机总模型-复飞\",\"children\":[]},{\"keyword\":\"mcheck1\",\"name\":\"全机总模型-操纵检查Ⅰ\",\"children\":[]},{\"keyword\":\"mcheck2\",\"name\":\"全机总模型-操纵检查Ⅱ\",\"children\":[]},{\"keyword\":\"nose_cold\",\"name\":\"全机总模型-机头低温\",\"children\":[]},{\"keyword\":\"nose_cold_fs\",\"name\":\"全机总模型-机头低温风挡破损\",\"children\":[]},{\"keyword\":\"nose_hot\",\"name\":\"全机总模型-机头高温\",\"children\":[]},{\"keyword\":\"nose_hot_fs\",\"name\":\"全机总模型-机头高温风挡破损\",\"children\":[]}]},{\"keyword\":\"set\",\"name\":\"单元/节点输出集\",\"children\":[]},{\"keyword\":\"ht\",\"name\":\"平尾加载点\",\"children\":[]}]";
        List<IsfdMeshSectionInfoConfigBo> sectionInfoConfigBoList = IsfdMeshSectionInfoConfigBo.init(sectionInfoConfig);

        String fileNames = "C919S_S10_R2_D20240124_section_node,C919S_S11_R2_D20240222_NLG,C919S_S11_R2_D20240725,C919S_S11_R2_D20240725_FS,C919S_S11_R2_D20240725_hot,C919S_S11_R2_D20240725_hot_FS,C919S_S11_R2_D20240725_cold,C919S_S11_R2_D20240725_cold_FS,C919S_S12_R2_D20240906,C919S_S20_R2_D20240802,C919S_S31_R2_D20240830,C919S_S32_R2_D20240126,C919S_S32_R2_D20240126_section_card,C919S_S50_R2_D20240126_1,C919S_S50_R2_D20240126_1_CZJC,C919S_S50_R2_D20240126_rudderfine,C919S_S50_R2_D20240126_3,C919S_S60_R2_D20240222_1,C919S_S60_R2_D20240222_1_CZJC,C919S_S60_R2_D20240222_elevfine,C919S_S60_R2_D20240222_3,C919S_S70_R2_D20240105_AILERON,C919S_S80_R2_D20240105_AILERON,C919S_S70_R2_D20240105_INFLAP_00,C919S_S70_R2_D20240105_INFLAP_19,C919S_S70_R2_D20240105_INFLAP_25,C919S_S70_R2_D20240105_INFLAP_34,C919S_S80_R2_D20240105_INFLAP_00,C919S_S80_R2_D20240105_INFLAP_19,C919S_S80_R2_D20240105_INFLAP_25,C919S_S80_R2_D20240105_INFLAP_34,C919S_S70_R2_D20240105_OUTFLAP_00,C919S_S70_R2_D20240105_OUTFLAP_19,C919S_S70_R2_D20240105_OUTFLAP_25,C919S_S70_R2_D20240105_OUTFLAP_34,C919S_S80_R2_D20240105_OUTFLAP_00,C919S_S80_R2_D20240105_OUTFLAP_19,C919S_S80_R2_D20240105_OUTFLAP_25,C919S_S80_R2_D20240105_OUTFLAP_34,C919S_S70_R2_D20240118_LINK_AI,C919S_S70_R2_D20240118_LINK_AI_CZJC,C919S_S70_R2_D20240229_LINK_CWB,C919S_S70_R2_D20240229_LINK_FL,C919S_S70_R2_D20240109_LINK_FLAP_TRACK,C919S_S80_R2_D20240109_LINK_FLAP_TRACK,C919S_S70_R2_D20240109_LINK_TRACK,C919S_S70_R2_D20240109_LINK_TRACK_CZJC,C919S_S80_R2_D20240109_LINK_TRACK,C919S_S70_R2_D20240103_SLAT_0,C919S_S70_R2_D20240103_SLAT_21,C919S_S70_R2_D20240103_SLAT_26p5,C919S_S80_R2_D20240103_SLAT_0,C919S_S80_R2_D20240103_SLAT_21,C919S_S80_R2_D20240103_SLAT_26p5,C919S_S70_R2_D20240103_SLAT_ADD,C919S_S70_R2_D20240103_SLAT_ADD_1,C919S_S80_R2_D20240103_SLAT_ADD,C919S_S80_R2_D20240103_SLAT_ADD_1,C919S_S70_R2_D20240229_LINK_SLAT_FL_0,C919S_S70_R2_D20240229_LINK_SLAT_FL_0_1,C919S_S70_R2_D20240229_LINK_SLAT_FL_0_CZJC,C919S_S70_R2_D20240229_LINK_SLAT_FL_21,C919S_S70_R2_D20240229_LINK_SLAT_FL_21_1,C919S_S70_R2_D20240229_LINK_SLAT_FL_26p5,C919S_S70_R2_D20240229_LINK_SLAT_FL_26p5_1,C919S_S70_R2_D20240229_LINK_SLAT_FL_26p5_CZJC,C919S_S80_R2_D20240229_LINK_SLAT_FL_0,C919S_S80_R2_D20240229_LINK_SLAT_FL_0_1,C919S_S80_R2_D20240229_LINK_SLAT_FL_21,C919S_S80_R2_D20240229_LINK_SLAT_FL_21_1,C919S_S80_R2_D20240229_LINK_SLAT_FL_26p5,C919S_S80_R2_D20240229_LINK_SLAT_FL_26p5_1,C919S_S70_R2_D20240109_TE,C919S_S80_R2_D20240109_TE,C919S_S70_R2_D20240229_LINK_TE,C919S_S70_R2_D20240729_FL,C919S_S80_R2_D20240729_FL,C919S_S70_R2_D20240105_12TRACK_00,C919S_S70_R2_D20240105_12TRACK_19,C919S_S70_R2_D20240105_12TRACK_19_CZJC,C919S_S70_R2_D20240105_12TRACK_25,C919S_S70_R2_D20240105_12TRACK_34,C919S_S70_R2_D20240105_12TRACK_34_CZJC,C919S_S70_R2_D20240105_34TRACK_00,C919S_S70_R2_D20240105_34TRACK_19,C919S_S70_R2_D20240105_34TRACK_25,C919S_S70_R2_D20240105_34TRACK_34,C919S_S80_R2_D20240105_12TRACK_00,C919S_S80_R2_D20240105_12TRACK_19,C919S_S80_R2_D20240105_12TRACK_25,C919S_S80_R2_D20240105_12TRACK_34,C919S_S80_R2_D20240105_34TRACK_00,C919S_S80_R2_D20240105_34TRACK_19,C919S_S80_R2_D20240105_34TRACK_25,C919S_S80_R2_D20240105_34TRACK_34,C919S_S70_R2_D20240109_SPOILER,C919S_S70_R2_D20240109_SPOILER_CZJC,C919S_S70_R2_D20240108_LINK_SP_TE,C919S_S70_R2_D20240311_OUTWINGBOX,C919S_S80_R2_D20240311_OUTWINGBOX,C919S_S70_R2_D20240108_WINGLET,C919S_S70_R2_D20240108_LINK_WINGLET,C919S_S70_R2_D20240219_CWB,C919S_S70_R2_D20240125_pylon_node,C919S_S90_R2_D20240814.out,C919S_S70_R2_TAKEOFF.dat ,C919S_S70_R2_CRUISE.dat,C919S_S70_R2_LANDING.dat,C919S_S70_R2_GOAROUND.dat,C919S_S70_R2_CZJC1.dat,C919S_S70_R2_CZJC2.dat,Model_00,Model_takeoff,Model_cruise,Model_land,Model_goaround,Model_mcheck1,Model_mcheck2,Model_nose_cold,Model_nose_cold_fs,Model_nose_fs,Model_nose_hot,Model_nose_hot_fs,setall,ht_load_node,ht_RBE3_node,,";
        for (String fileName : fileNames.split(",")) {
            IsfdMeshSectionInfoConfigBo matchResult = matchFileKeyAndName(sectionInfoConfigBoList, fileName, null);
            System.out.println(fileName + " 匹配到的 targetName: " + matchResult.getName() + "对应的key是： " + matchResult.getKeyword());
        }

    }
}
